-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
fs: cache context lookup in vectored io loops #61387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fs: cache context lookup in vectored io loops #61387
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61387 +/- ##
==========================================
- Coverage 88.54% 88.51% -0.03%
==========================================
Files 704 704
Lines 208793 208797 +4
Branches 40307 40315 +8
==========================================
- Hits 184866 184810 -56
- Misses 15913 15966 +53
- Partials 8014 8021 +7
🚀 New features to boost your workflow:
|
addaleax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also move Realm::context() into node_realm-inl.h so that the compiler can already make this optimization itself.
thanks, I used |
addaleax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be sure to update the commit message/PR title here as well
| return isolate_; | ||
| } | ||
|
|
||
| inline v8::Local<v8::Context> Realm::context() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding inline here isn't that important, but it should be applied in node_realm.h, next to virtual.
And since this is a virtual method, I think you'll want to mark the PrincipalRealm and ShadowRealm classes as final as well, otherwise the compiler won't be able to know that there's no subclass which overrides the method (in other words, otherwise the compiler won't know that the method can actually be inlined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and make it so Environment::principal_realm() returns a PrincipalRealm* pointer rather than a Realm* pointer – seems compilers can't always see through the cast that currently happens in that method)
I tried to prevent the call from being repeated